#include "junix.h"

int main(int argc, char **argv)
{
	struct sockaddr_in sin;
	memset(&sin, 0, sizeof(sin));
	sin.sin_family=AF_INET;
	sin.sin_port= htons(123);

	if( inet_pton(AF_INET, argv[1], &(sin.sin_addr)) < 0)
		err_sys("inet_pton");

	int fd=Socket(AF_INET, SOCK_DGRAM, 0);
	
	char *p ="hello,world!\n";
	if( sendto(fd, p, strlen(p)+1, 0, 
				(struct sockaddr*)&sin, (socklen_t)sizeof(sin) ) < 0 )
		err_sys("sendto");

    exit(0);
}

